import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import '@/assets/styles/index.scss' // global css

import './assets/icons' // icon
import {
  maskString
} from "@/utils/tool";

import CustomForm from '@/components/customForm'
import CustomDescriptions from '@/components/customDescriptions'
import elImageCustom from '@/components/elImageCustom/main';

Vue.use(ElementUI);
Vue.config.productionTip = false

// 全局组件挂载
Vue.component('CustomForm', CustomForm)
Vue.component('CustomDescriptions', CustomDescriptions)
Vue.component('elImageCustom', elImageCustom)

//挂载信息脱敏方法
Vue.prototype.$maskString = maskString;

//挂载全局loading方法
Vue.prototype.$setLoading = (text = 'Loading') => {
  let loading = Vue.prototype.$loading({
      lock: true,
      text: text,
      spinner: 'el-icon-loading',
      background: 'rgba(0, 0, 0, 0.7)'
  });
  return loading;
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
